package com.pro.service.imple;

import com.pro.mapper.JsCommentMapper;
import com.pro.pojo.JsComment;
import com.pro.pojo.JsProduct;
import com.pro.service.JsCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author cyj
 * @date 2002.3.11$ 15.33$
 * @content :
 */
@Service
public class JsCommentServiceImple implements JsCommentService {

    @Autowired
    private JsCommentMapper mapper;

    @Override
    public List<JsComment> selectGoodComment(Integer type,String status,Integer page,Integer limit) {
        page = (page-1) * limit;
        List<JsComment> goodComment = mapper.selectGoodComment(type,status,page,limit);
        return goodComment;
    }

    @Override
    public Integer GoodCommentCount(Integer type,String status) {
        return mapper.GoodCommentCount(type,status);
    }

    /**
     * @author cyj
     * @date 2022.3.25$ 13.31$
     * @content : 获取后台人员的评论
     */
    @Override
    public List<JsComment> selectAfterGoodComment(Integer type, String status, Integer page, Integer limit) {
        page = (page-1) * limit;
        return mapper.selectAfterGoodComment(type,status,page,limit);
    }

    @Override
    public Integer countComm(String userType,String commentDate) {
        return mapper.countComm(userType,commentDate);
    }

    @Override
    public List<JsComment> countPeo(String userType,String commentDate) {
        return mapper.countPeo(userType,commentDate);
    }

    /**
     * @author cyj
     * @date 2022.3.25$ 11.38$
     * @content : 后台人员评论计数
     */
    @Override
    public Integer afterGoodCommentCount(Integer type, String status) {
        return mapper.afterGoodCommentCount(type,status);
    }
    /**
     * @author cyj
     * @date 2022.3.25$ 16.11$
     * @content : 获取一个评论的详细信息
     */
    @Override
    public JsProduct getOnlyComment(Integer id) {
        return mapper.getOnlyComment(id);
    }
    /**
     * @author cyj
     * @date 2022.3.25$ 16.22$
     * @content : 拦截一条评论
     */
    @Override
    public Boolean interceptComment(Integer id, String status) {
        return mapper.interceptComment(id,status);
    }
    /**
     * @author cyj
     * @date 2022.3.25$ 16.36$
     * @content : 删除一条评论
     */
    @Override
    public Boolean delComment(Integer id) {
        return mapper.delComment(id);
    }
    /**
     * @author cyj
     * @date 2022.3.25$ 17.01$
     * @content : 获取一条后台评论详细信息
     */
    @Override
    public JsProduct getOnlyAfterComment(Integer id) {
        return mapper.getOnlyAfterComment(id);
    }

}
